var __tnt=window.__tnt||{};(function(u,c,s,m,g){var o=m.ads||(m.ads={}),n={};o.curl=function(t){var e='<div class="small-ad"><img alt="advertisement" title="'+n.setTitle(t.width,t.height,t.type)+'" src="'+t.smallImage+'"/></div>',i='<div class="large-ad"><img alt="advertisement" title="'+n.setTitle(t.width,t.height,t.type)+'" src="'+t.largeImage+'"/></div>',l="";if(t.clickuri){var r=t.clickuri.replace(/"/g,"&quot;");l='<div class="hidden-sm hidden-xs page-curl page-curl-image"><a target="_blank" href="'+r+'"><div class="cover"></div></a>'+e+i+"</div>"}else l='<div class="hidden-sm hidden-xs page-curl page-curl-image"><div class="cover"></div>'+e+i+"</div>";n.paint(t,l)},o.expandable=function(t){var e='<div class="tnt-expandable-small" style="cursor: pointer"><img alt="advertisement" title="'+n.setTitle(t.width,t.height,t.type)+'" src="'+t.smallImage+'"/></div>',i='<div class="tnt-expandable-big" style="display: none;"><img alt="advertisement" title="'+n.setTitle(t.width,t.height,t.type)+'" src="'+t.largeImage+'" /></div>',l=e+i;n.paint(t,l).then(n.setWrapper(t)).then(n.setLink(t)).then(n.setTrigger(t)).then()},o.html=function(t){t.width||(t.width=s(t.positionDiv).closest(".tncms-region-ads").prev().data("tnt-ads-tmp").width),n.paint(t,t.html)},o.image=function(t){var e="",i="";if(typeof t.clickuri<"u"&&(e=t.clickuri.replace(/"/g,"&quot;")),t.display=="wallpaper"){var l=t.height,r=c.getElementsByTagName("body")[0];r.style.backgroundImage="url("+t.asseturl+")",r.style.height=l+"px",r.className+=" wallpaper-ad ",t.clickuri&&(i+='<a href="'+t.clickuri+'" target="'+t.target+'" style="width:100%; height: 100%; display:block"></a>')}else if(t.display=="anchor"){var a="fas tnt-times";i=t.clickuri===""?'<a href="#" class="close" data-dismiss="alert"><span class="'+a+'"></span></a><img alt="advertisement" title="'+n.setTitle(t.width,t.height,t.type)+'" style="width: '+t.width+'px; height: auto; " src="'+t.asseturl+'" />':'<a href="#" class="close" data-dismiss="alert"><span class="'+a+'"></span></a><a href="'+e+'" target="'+t.target+'" style="display:block"><img alt="advertisement" title="'+n.setTitle(t.width,t.height,t.type)+'" style="width: '+t.width+'px; height: auto; " src="'+t.asseturl+'" /></a>'}else i=t.clickuri===""?'<img alt="advertisement" title="'+n.setTitle(t.width,t.height,t.type)+'" src="'+t.asseturl+'" style="width: 100%;" />':'<a href="'+e+'" target="'+t.target+'" style="display:block"><img alt="advertisement" title="'+n.setTitle(t.width,t.height,t.type)+'" src="'+t.asseturl+'" style="width: 100%;" /></a>';n.paint(t,i)},o.text=function(t){var e=n.overline(t),i="";if(t.width||(t.width=s(t.positionDiv).closest(".tncms-region-ads").prev().data("tnt-ads-tmp").width),(typeof e>"u"||e===null)&&(e="Advertisement"),t.clickuri){var l=t.clickuri.replace(/"/g,"&quot;");i='<div class="tnt-text-ad-container"><a href="'+l+'" target="'+t.target+'">'+t.title+"</a><br/>"+t.text+'<br/><span class="tnt-text-ad-flag">'+e+"</span></div>"}else i='<div class="tnt-text-ad-container"><strong>'+t.title+"</strong><br/>"+t.text+'<br/><span class="tnt-text-ad-flag">'+e+"</span></div>";n.paint(t,i)},o.popup=function(t){var e=c.createElement("div"),i="";if(e.setAttribute("id","BlackOutDiv"),e.style.position="fixed",e.style.top=0,e.style.left=0,e.style.width="100%",e.style.height="100%",e.style.zIndex=10000001,e.style.backgroundColor="black",e.style.opacity=.9,e.style.filter="alpha(opacity=90)",i+='<span><i class="fas tnt-times tnt-2x"></i></span>',t.type=="video"){var l="video/mp4";t.asseturl.match(/\.flv\?/)!=null&&(l="video/x-flv"),t.clickuri&&(i+='<a style="display: block; height: 100%; position: absolute; width: 100%;" target="_blank" href="'+t.clickuri+'"></a>'),i+='<video class="tnt-popup-video" autoplay><source src="'+t.asseturl+'" type="'+l+'"/></video>'}else if(t.type=="text"){var r=n.overline(t);if((typeof r>"u"||r===null)&&(r="Advertisement"),t.clickuri){var a=t.clickuri.replace(/"/g,"&quot;");i+='<div class="tnt-text-ad-container"><a href="'+a+'" target="'+t.target+'">'+t.title+"</a><br/>"+t.text+'<br/><span class="tnt-text-ad-flag">'+r+"</span></div>"}else i+='<div class="tnt-text-ad-container"><strong>'+t.title+"</strong><br/>"+t.text+'<br/><span class="tnt-text-ad-flag">'+r+"</span></div>"}else if(t.type=="image"){var p="";typeof t.clickuri<"u"&&(p="http://"+t.clickuri.replace(/"/g,"&quot;")),i+=t.clickuri===""?'<img alt="advertisement" title="'+n.setTitle(t.width,t.height,t.type)+'" class="img-responsive" width="'+t.width+'" height="'+t.height+'" src="'+t.asseturl+'">':'<a target="'+t.target+'" href="'+p+'"><img alt="advertisement" title="'+n.setTitle(t.width,t.height,t.type)+'" class="img-responsive" width="'+t.width+'" height="'+t.height+'" src="'+t.asseturl+'"></a>'}else if(t.type=="html")i+='<div style="width: 100%; height: 100%; max-width:'+t.width+"px; max-height:"+t.height+'px;">',i+=t.html,i+="</div>";else if(t.type=="html5"){var h="//"+t.cdn+"/content/tncms/ads/__html5/"+t.uuid+"/"+t.html5_id+"/"+t.htmlfile;t.clickuri&&(h+="?clickTag="+encodeURIComponent(t.clickuri)),i+='<div style="width: 100%; height: 100%; max-width:'+t.width+"px; max-height:"+t.height+'px;">',i+='<iframe id="html5-ad-frame-'+t.uuid+'" width="'+t.width+'" height="'+t.height+'" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="'+h+'">',i+="</iframe>",i+="</div>"}i+="</div>";function v(){s("#blox-ad-position-_popup1").remove(),s("#BlackOutDiv").remove()}typeof e.addEventListener<"u"?e.addEventListener("click",v,!1):(c.compatMode=="BackCompat"&&(e.style.width="110%",e.style.height="110%",e.style.position="absolute"),e.attachEvent("onclick",v)),c.getElementsByTagName("body")[0].appendChild(e),TNCMS.AdManager.renderAd(t),n.paint(t,i)},n={getAnimationSpeed:function(t){switch(t){case"slow":return 1e3;case"medium":return 500;case"fast":return 250;case"instant":return 0;default:return 500}},overline:function(t){var e;return s(t.positionDiv).closest(".tncms-region-ads").prev().attr("data-tnt-ads-tmp")?e=s(t.positionDiv).closest(".tncms-region-ads").prev().data("tnt-ads-tmp").overline:s(t.positionDiv).attr("data-tnt-ads")&&(e=s(t.positionDiv).data("tnt-ads").overline),e},paint:function(t,e){var i=new s.Deferred,l=["tnt-ads","tnt-"+t.type+"-ad-wrapper"],r="";if(t.display=="anchor"?l.push("tnt-ads-anchor","alert"):t.display=="popup"&&l.push("tnt-ads-popup"),r=l.join(" "),t.display=="wallpaper")s("#wallpaper-left").empty().append(e),s("#wallpaper-right").empty().append(e);else if(t.display=="popup")s(t.positionDiv).empty().removeAttr("style").removeClass().addClass(r).css({"max-width":t.width+"px","max-height":t.height+"px"}).append(e);else if(s(t.positionDiv).empty().removeAttr("style").removeClass().addClass(r).css({"max-width":t.width+"px"}).append(e),s(u).width()==320&&t.width<=320&&t.width>s(t.positionDiv).width()){var a=Math.round((s(t.positionDiv).width()-t.width)/2);s(t.positionDiv).css({margin:"0 "+a+"px"})}if(t.type!="text"){var p=n.overline(t);if(p&&s(t.positionDiv).siblings(".tnt-ads-overline").length<1){var h='<div class="tnt-ads-overline">'+p+"</div>";s(t.positionDiv).before(h)}}return i.resolve(t),i.promise()},setAnimation:function(t,e){var i=new s.Deferred,l=s(t.positionDiv).find(".tnt-expandable-big"),r=e===0?e:n.getAnimationSpeed(t.transition_speed);switch(t.overlay_content){case"0":l.addClass("noOverlay");break;case"1":l.addClass("overlay");break}switch(t.transition_direction){case"left":l.css({position:"absolute",top:0,"z-index":999,right:t.width}).stop().animate({width:"toggle"},r);break;case"right":l.css({position:"absolute",top:0,left:t.width,"z-index":999}).stop().animate({width:"toggle"},r);break;case"up":l.css({position:"absolute",bottom:t.height,left:0,"z-index":999}).stop().slideToggle(r);break;default:l.css({left:0,"z-index":999}).stop().slideToggle(r);break}return i.resolve(t),i.promise()},setLink:function(t){var e=new s.Deferred;return t.clickuri&&(s(t.positionDiv).find(".tnt-expandable-big img").wrap('<a target="_blank" rel="noopener" href="'+t.clickuri+'"></a>'),t.start_open!=0&&s(t.positionDiv).find(".tnt-expandable-small img").wrap('<a target="_blank" rel="noopener" href="'+t.clickuri+'"></a>')),e.resolve(t),e.promise()},setTitle:function(t,e,i){return t.toString()+"x"+e.toString()+" "+i+" ad"},setTrigger:function(t){var e=new s.Deferred;switch(t.start_open){case"1":n.setAnimation(t,0),t.auto_limit!=="0"?setTimeout(function(){n.setAnimation(t)},t.auto_limit*1e3):s(t.positionDiv).find(".tnt-expandable-small").on("click",function(){n.setAnimation(t)});break;case"2":s(t.positionDiv).on("mouseover mouseout",function(){n.setAnimation(t)});break;case"3":n.setAnimation(t,0),s(t.positionDiv).find(".tnt-expandable-small").addClass("click-to-close"),t.auto_limit!=="0"?(setTimeout(function(){n.setAnimation(t)},t.auto_limit*1e3),setTimeout(function(){s(t.positionDiv).on("mouseover mouseout",function(){n.setAnimation(t)})},t.auto_limit*1e3+500)):s(t.positionDiv).find(".tnt-expandable-small").hasClass("click-to-close")&&s(t.positionDiv).find(".tnt-expandable-small").on("click hover",function(){n.setAnimation(t)});break;default:s(t.positionDiv).find(".tnt-expandable-small").on("click",function(){n.setAnimation(t)});break}return e.resolve(t),e.promise()},setWrapper:function(t){var e=new s.Deferred;return s(t.positionDiv).css("position","relative"),e.resolve(t),e.promise()}}})(window,document,jQuery,__tnt);
//# sourceMappingURL=tnt.ads.init.c2b9574823d0d16ffc6f20eef83f4232.js.map